<template>
    <div class="wiper">
    <swiper :options="swiperOptions" v-if="showSwiper">
        <swiper-slide v-for="item of list" :key="item.id">
            <img class="img-swiper" :src="item.imgUrl">
        </swiper-slide>
   <div class="swiper-pagination" slot="pagination"></div>
    </swiper>

    </div>
</template>

<script>
    export default {
        name: "HomeSwiper",
        props:{
            list:Array
        },
        data:function() {
            return {
                swiperOptions: {
                    pagination: '.swiper-pagination',
                    loop:true
                },
            }
        },
        computed:{
            showSwiper:function(){
                return this.list.length
            }
        }
    }
</script>

<style lang="stylus" scoped>
.wiper >>>.swiper-pagination-bullet-active
  background #fff
.wiper
    overflow hidden
    width 100%
    height 31%
    color #ccc
   .img-swiper
      width 100%
      height 3rem
</style>